home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEM / I-M / LineShare DEMO.sea / ARA_LineShare next >
Text File  |  1992-12-25  |  2KB  |  143 lines

  1. !
  2. ! ARA script for connections trough
  3. ! a LineShare subPort.
  4. ! All modem-specific commands should be moved to the LineShare script.
  5. ! So, this ARA script is universal
  6. ! We assume that the LineShare script sets the modem in the
  7. ! "direct" connections (i.e. "\N1"), at least for our subPort.
  8. ! We also assume that the LineShare script reports "CONNECT XXXX" messages
  9. ! Our business is to adjust the serial port speed.
  10. ! We don't process the "^2" parameter, since it's controlled with LineShare
  11. !
  12. @ORIGINATE
  13. @ANSWER
  14. !
  15. ! Load Factory configurations (i.e. reset the LineShare emulator),switch off the echo
  16. !
  17. matchclr
  18. matchstr 1 1 "OK\13\10"
  19. write "AT&FE0\13"
  20. matchread 10
  21. jump 59
  22. !
  23. ! The modem is ready so enable answering, or originate a call
  24. !
  25. @LABEL 1
  26. matchclr
  27. ifAnswer 2
  28. note "Dialing ^1" 3
  29. write "ATD^1\13"
  30. jump 3
  31. @LABEL 2
  32. matchstr 1 3 "OK\13\10"
  33. write "ATS0=1\13"
  34. matchread 30
  35. jump 59
  36. !
  37. @LABEL 3
  38. matchclr
  39. matchstr 1 11 "CONNECT 1200\13\10"
  40. matchstr 2 12 "CONNECT 2400\13\10"
  41. matchstr 3 13 "CONNECT 4800\13\10"
  42. matchstr 4 14 "CONNECT 7200\13\10"
  43. matchstr 5 15 "CONNECT 9600\13\10"
  44. matchstr 6 16 "CONNECT 12000\13\10"
  45. matchstr 7 17 "CONNECT 14400\13\10"
  46. matchstr 8 18 "CONNECT 19200\13\10"
  47. matchstr 9  4  "RING\13\10"
  48. matchstr 10 50 "NO CARRIER\13\10"
  49. matchstr 11 50 "ERROR\13\10"
  50. matchstr 12 52 "NO DIALTONE\13\10"
  51. matchstr 13 53 "BUSY\13\10"
  52. matchstr 14 54 "NO ANSWER\13\10"
  53. matchread 800
  54. ifAnswer 2
  55. jump 59
  56. !
  57. @LABEL 4
  58. ifOriginate 3
  59. userhook 1
  60. note "Answering phone…" 2
  61. jump 3
  62. !
  63. @LABEL 11
  64. note "Communicating at 1200 bps." 2
  65. setspeed 1200
  66. jump 20
  67. !
  68. @LABEL 12
  69. note "Communicating at 2400 bps." 2
  70. setspeed 2400
  71. jump 20
  72. !
  73. @LABEL 13
  74. note "Communicating at 4800 bps." 2
  75. setspeed 4800
  76. jump 20
  77. !
  78. @LABEL 14
  79. note "Communicating at 7200 bps." 2
  80. setspeed 7200
  81. jump 20
  82. !
  83. @LABEL 15
  84. note "Communicating at 9600 bps." 2
  85. setspeed 9600
  86. jump 20
  87. !
  88. @LABEL 16
  89. !note "Communicating at 12000 bps." 2
  90. setspeed 12000
  91. jump 20
  92. !
  93. @LABEL 17
  94. note "Communicating at 14400 bps." 2
  95. setspeed 14400
  96. jump 20
  97. !
  98. @LABEL 18
  99. note "Communicating at 19200 bps." 2
  100. setspeed 19200
  101. jump 20
  102. !
  103. @LABEL 20
  104. ifANSWER 21
  105. pause 30
  106. @LABEL 21
  107. exit 0
  108. !
  109. ! 50: error messages
  110. ! No carrier
  111. @LABEL 50
  112. exit -6021
  113. ! No Dial Tone
  114. @LABEL 52
  115. exit -6020
  116. ! Busy
  117. @LABEL 53
  118. exit -6022
  119. ! No Answer
  120. @LABEL 54
  121. exit -6023
  122. ! Modem error
  123. @LABEL 59
  124. exit -6019
  125. !
  126. ! Hang up the modem
  127. !
  128. @HANGUP
  129. settries 0
  130. @LABEL 60
  131. DTRClear
  132. pause 2
  133. DTRSet
  134. write "ATZ\13"
  135. matchclr
  136. matchstr 1 62 "OK\13\10"
  137. matchread 30
  138. inctries
  139. iftries 3 62
  140. jump 60
  141. !
  142. @LABEL 62
  143. exit 0